package prefix.transaction;

import prefix.exception.TransactionException;
import prefix.integration.wm.AbstractWalletManager;
import prefix.integration.wm.AbstractWalletManager.ExecutionStatus;
import prefix.integration.wm.AbstractWalletManager.WMStatus;
import models.Transaction;
import models.WmTransaction;

public abstract class AbstractTransaction {

    protected Transaction dbTrans;

    protected AbstractWalletManager manager = AbstractWalletManager.getInstance();

    abstract  ExecutionStatus executeTransaction() throws TransactionException;

    abstract void beforeExecuteTransaction();

    abstract void afterExecuteTransaction() throws TransactionException;

    abstract void reconcileTransaction();

    abstract void beforeReconcile();

    abstract void afterReconcile();

    abstract void validateAmount() throws TransactionException;
    
    abstract void validateAmountOnFail() throws TransactionException;

    abstract Transaction.Type[] getAcceptedTypes();
    
    abstract void validateWallet() throws TransactionException;

    abstract Integer executeCreateTransaction() throws TransactionException;

    abstract ExecutionStatus executeRollbackTransaction() throws TransactionException;

    public Transaction getDbTrans() {
        return dbTrans;
    }

    public void setDbTrans(Transaction dbTrans) {
        this.dbTrans = dbTrans;
    }

}
